package com.itheima.Demo02;

import java.util.Base64;

public class Demo001 {
    //基本编码解码
    public static void main(String[] args) {
        //编码
        Base64.Encoder encoder = Base64.getEncoder();
        String s = "{\"广州\":\"020\"}";
        String s1= encoder.encodeToString(s.getBytes());
        System.out.println("编码前"+s);
        System.out.println("编码后"+s1);
        //解码;
        Base64.Decoder d = Base64.getDecoder();
        byte[] b = d.decode(s1);
        System.out.println("解码后"+new String(b));


    }
}
